package com.yaoandw.storage;

public class FrontierFactory {
	private static Frontier bdbFrontier;
	private static VisitedFrontier visitedFrontier;

	public static Frontier getFrontier(String bdbDir) {
		if (bdbFrontier == null) {
			try {
				bdbFrontier = new BDBFrontier(bdbDir);
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
		return bdbFrontier;
	}
	public static VisitedFrontier getVisitedFrontier() {
		if (visitedFrontier == null) {
			try {
				visitedFrontier = new SimpleBloomFilter();
			} catch (Exception e1) {
				e1.printStackTrace();
			}
		}
		return visitedFrontier;
	}
}
